const { sequelize, Sequelize } = require('../../database/init')
const QuestionBase = sequelize.define('QuestionBase', {
    qb_name: {
        type: Sequelize.STRING,
        allowNull:false,
        commit:"题库的名字"
    },
    qb_description: {
        type: Sequelize.STRING,
        allowNull:true,
        commit:"题库的介绍"
    }
})
const Question = sequelize.define('Question', {
    title:{
        type: Sequelize.STRING,
        commit:"题目的问题"
    },
    type:{
        type:Sequelize.SMALLINT,
        allowNull:false,
        commit:"题目的类型"
    },
    analysis:{
        type: Sequelize.STRING,
        commit:"题目的解析"
    },
    difficulty:{
        type: Sequelize.FLOAT,
        commit:"题目难度"
    },
    qt_body:{
        type:Sequelize.JSON,
        allowNull:false,
        commit:"题目的主体"
    }
})
//单独建表
//QuestionBase.sync();
module.exports = {
    QuestionBase,
    Question
}